package dcc.ui;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;

public class ErrorDialog extends JDialog {

	public ErrorDialog() {
		setResizable(false);
		setVisible(true);
		setName("");
		setTitle("\u9519\u8BEF\u4FE1\u606F");
		setModal(true);
		setBounds(100, 100, 250, 128);
		getContentPane().setLayout(null);

		JButton btnOK = new JButton("\u786E\u5B9A");
		btnOK.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				exitApplication();
			}
		});
		btnOK.setBounds(164, 60, 70, 23);
		getContentPane().add(btnOK);

		JLabel lblErrorInformation = new JLabel(
				"\u8F6F\u4EF6\u542F\u52A8\u5931\u8D25\uFF0C\u8BF7\u548C\u7BA1\u7406\u5458\u8054\u7CFB\u3002");
		lblErrorInformation.setBounds(10, 10, 224, 40);
		getContentPane().add(lblErrorInformation);
	}

	private void exitApplication() {
		System.exit(0);
	}
}
